% Intrinsic and Extrinsic Camera Parameters
%
% This script file can be directly executed under Matlab to recover the camera intrinsic and extrinsic parameters.
% IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points.
%            All those complementary variables are saved in the complete matlab data file Calib_Results.mat.
% For more information regarding the calibration model visit http://www.vision.caltech.edu/bouguetj/calib_doc/


%-- Focal length:
fc = [ 1600.281660457759500 ; 1515.996249171649400 ];

%-- Principal point:
cc = [ 703.901427560668030 ; 540.524706046573210 ];

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ 1.617858762084471 ; -4.031216147102882 ; -0.060982725258023 ; 0.159825488829207 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 196.683253948206670 ; 129.322539581737460 ];

%-- Principal point uncertainty:
cc_error = [ 135.210233365850770 ; 43.706357558970502 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.750331551491621 ; 7.570158815486741 ; 0.051111638739314 ; 0.152444378028832 ; 0.000000000000000 ];

%-- Image size:
nx = 1078;
ny = 1078;


%-- Various other variables (may be ignored if you do not use the Matlab Calibration Toolbox):
%-- Those variables are used to control which intrinsic parameters should be optimized

n_ima = 8;						% Number of calibration images
est_fc = [ 1 ; 1 ];					% Estimation indicator of the two focal variables
est_aspect_ratio = 1;				% Estimation indicator of the aspect ratio fc(2)/fc(1)
center_optim = 1;					% Estimation indicator of the principal point
est_alpha = 0;						% Estimation indicator of the skew coefficient
est_dist = [ 1 ; 1 ; 1 ; 1 ; 0 ];	% Estimation indicator of the distortion coefficients


%-- Extrinsic parameters:
%-- The rotation (omc_kk) and the translation (Tc_kk) vectors for every calibration image and their uncertainties

%-- Image #1:
omc_1 = [ 2.177777e+00 ; 2.092719e+00 ; -2.311967e-01 ];
Tc_1  = [ -3.197109e+03 ; -1.689260e+03 ; 1.470608e+04 ];
omc_error_1 = [ 4.423408e-02 ; 5.966637e-02 ; 1.305629e-01 ];
Tc_error_1  = [ 1.234618e+03 ; 4.326220e+02 ; 1.222080e+03 ];

%-- Image #2:
omc_2 = [ 1.818674e+00 ; 1.682775e+00 ; -5.254860e-01 ];
Tc_2  = [ -3.025731e+03 ; -1.179238e+03 ; 1.469799e+04 ];
omc_error_2 = [ 2.043826e-02 ; 4.503536e-02 ; 9.614880e-02 ];
Tc_error_2  = [ 1.239876e+03 ; 4.302702e+02 ; 1.211640e+03 ];

%-- Image #3:
omc_3 = [ 2.004379e+00 ; 1.921518e+00 ; -1.991994e-01 ];
Tc_3  = [ -2.937529e+03 ; -9.380217e+02 ; 1.467075e+04 ];
omc_error_3 = [ 2.422335e-02 ; 4.298496e-02 ; 1.131632e-01 ];
Tc_error_3  = [ 1.242202e+03 ; 4.300644e+02 ; 1.229340e+03 ];

%-- Image #4:
omc_4 = [ 5.859131e-01 ; 2.410156e+00 ; -1.977270e-01 ];
Tc_4  = [ -1.274240e+03 ; -1.628949e+03 ; 1.466514e+04 ];
omc_error_4 = [ 1.298401e-02 ; 7.071198e-02 ; 6.821335e-02 ];
Tc_error_4  = [ 1.234297e+03 ; 4.222984e+02 ; 1.143346e+03 ];

%-- Image #5:
omc_5 = [ 1.719201e+00 ; 1.579105e+00 ; 6.590099e-01 ];
Tc_5  = [ -2.397935e+03 ; -1.542443e+03 ; 1.236296e+04 ];
omc_error_5 = [ 3.542320e-02 ; 5.415158e-02 ; 8.888115e-02 ];
Tc_error_5  = [ 1.047917e+03 ; 3.616590e+02 ; 1.057006e+03 ];

%-- Image #6:
omc_6 = [ -1.930591e+00 ; -2.121166e+00 ; 6.571963e-01 ];
Tc_6  = [ -1.458962e+03 ; -1.681669e+03 ; 1.417003e+04 ];
omc_error_6 = [ 5.489331e-02 ; 5.084344e-02 ; 9.349078e-02 ];
Tc_error_6  = [ 1.186351e+03 ; 4.125370e+02 ; 1.079093e+03 ];

%-- Image #7:
omc_7 = [ 2.024762e+00 ; 1.915644e+00 ; 2.091454e-01 ];
Tc_7  = [ -3.365685e+03 ; -9.201279e+02 ; 1.374965e+04 ];
omc_error_7 = [ 3.686910e-02 ; 4.674820e-02 ; 1.254465e-01 ];
Tc_error_7  = [ 1.179827e+03 ; 4.062825e+02 ; 1.159270e+03 ];

%-- Image #8:
omc_8 = [ -2.090769e+00 ; -2.205905e+00 ; 2.228201e-01 ];
Tc_8  = [ -2.110494e+03 ; -1.328478e+03 ; 1.433309e+04 ];
omc_error_8 = [ 6.606481e-02 ; 6.504553e-02 ; 1.229209e-01 ];
Tc_error_8  = [ 1.202291e+03 ; 4.171850e+02 ; 1.144701e+03 ];

